<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var ParkingSystem = function (big, medium, small) {
      this.map = {
        '1': big,
        '2': medium,
        '3': small
      }
    };

    ParkingSystem.prototype.addCar = function (carType) {
      return --this.map[carType] >= 0;
    };
    let num = new ParkingSystem(2, 1, 0)
    console.log(num.addCar(1))
    console.log(num.addCar(2))
    console.log(num.addCar(3))
    console.log(num.addCar(1))
  </script>
</body>

</html>